import request from '@/utils/request.ts'

interface Response {
  code: number
  message: string
  data: any
}

// 获取股票信息列表
export const get_stockInfoList = async (): Promise<Response> => {
  return request.get('/data/stock/get_stockInfoList')
}

// 获取单个股票的行情列表
export const get_stockPriceList = async (code: string, window: string, start_date: string, end_date: string): Promise<Response> => {
  return request.get('/data/stock/get_stockPriceList', {
    params: {
      code,
      start_date,
      end_date,
      window,
    },
  })
}

// 获取单个股票的筹码列表
export const get_stockChipList = async (code: string, window: string): Promise<Response> => {
  return request.get('/data/chip/get_stockChipList', {
    params: {
      code,
      window,
    },
  })
}

// 获得单个股票的日内动量
export const get_stockIntradayMovement = async (code: string, window: string, period: string): Promise<Response> => {
  return request.get('data/stock/get_stockIntradayMovement', {
    params: {
      code,
      window,
      period,
    },
  })
}

// 获得单个股票某日的日内动量
export const get_stockIntradayMovementWithDate = async (code: string, window: string, period: string, date: string): Promise<Response> => {
  return request.get('data/movement/getStockIntradayMovementWithDate', {
    params: {
      code,
      window,
      period,
      date,
    },
  })
}
